<?php
/**
 * DistributionShop.php
* 跨境电商商城系统
 * =============================================
 * Copy right 2016-2026 大连熠泽科技网络有限公司
 * ---------------------------------------------
 * 官方网址: http://www.yizehuitong.com
 * =============================================
 * @author : yizehuitong
 * @date : 2019.10
 * @version : v2.0
 */

namespace app\wap\controller;

/**
 * 分销
 */
class DistributionShop extends BaseWap
{
	/**
	 * 我的店铺
	 */
	public function userShopGoods()
	{
		$this->checkLogin();
		$uid = request()->get('uid', '');
		if (!$uid) $uid = $this->uid;
		$info = api('System.Distribution.promoterDetailByUid', [ 'uid' => $this->uid ]);
		$info = $info['data'];
		$this->assign("title_before", $info['promoter_shop_name'] . "的店铺");
		$this->assign("title", $info['promoter_shop_name'] . '的店铺');
		
		$category_id = request()->get('category_id', ''); // 商品分类
		$brand_id = request()->get('brand_id', ''); // 品牌
		$this->assign('brand_id', $brand_id);
		$this->assign('uid', $uid);
		$this->assign('category_id', $category_id);
		return $this->view($this->style . "/distribution_shop/usershopgoods");
	}
	
	/**
	 * 店铺分享
	 */
	public function userShopQrcode()
	{
		$uid = request()->get('source_uid', '');
		if (!$uid) $this->error("当前店铺信息不存在");
		api('System.Distribution.userFxQrcode');
		$url = __URL(__URL__ . "wap/index/shopindex?source_uid=$uid");
		$this->assign('url', $url);
		$this->assign('uid', $uid);
		$this->assign("title_before", "店铺分享");
		$this->assign("title", "店铺分享");
		return $this->view($this->style . "/distribution_shop/qrcode_shop");
	}
	
}